package my2Cents.properties;

import java.awt.Font;
import javax.swing.JLabel;

public class Header extends Property {
	private static final long serialVersionUID = 1L;
	private JLabel label;
	
	public Header(String txt) {
		this.setSize(10,28);
		label = new JLabel(txt + ":");
		label.setLocation(10,0);
		Font f = new Font("Arial Black", Font.BOLD, 15);
		label.setFont(f);
		add(label);
		//centerY(label);
	}
	
	public void validate() {
		super.validate();
		if(getParent() != null) {
			int w = getParent().getWidth();
			this.setSize(w,28);
			label.setSize(w,getHeight());
		}
	}
	
	public void setText(String txt) {
		label.setText(txt + ":");
	}
}
